package cn.bdqn.domain;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 订单对象
 * @author dkj
 */
public class Order implements Serializable {

    /**
     * id
     */
    private Integer id;

    /**
     * 客户id
     */
    private Integer clientId;

    /**
     * 客户id
     */
    private Client client;

    /**
     * 订单号
     */
    private String orderNumber;

    /**
     * 付款方式  1线上 2线下
     */
    private Integer paymentType;

    /**
     * 订单描述
     */
    private String orderDescribe;

    /**
     * 1.处理  2.未处理
     */
    private Integer state;

    /**
     * 订单货物
     */
    private List<OrderForm> orderForms = new ArrayList<>();


    public Integer getClientId() {
        return clientId;
    }

    public void setClientId(Integer clientId) {
        this.clientId = client==null?clientId:client.getId();
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public List<OrderForm> getOrderForms() {
        return orderForms;
    }

    public void setOrderForms(List<OrderForm> orderForms) {
        this.orderForms = orderForms;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }


    public Client getClient() {
        return client;
    }

    public void setClient(Client client) {
        this.client = client;
    }

    public String getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber == null ? null : orderNumber.trim();
    }

    public Integer getPaymentType() {
        return paymentType;
    }

    public void setPaymentType(Integer paymentType) {
        this.paymentType = paymentType;
    }

    public String getOrderDescribe() {
        return orderDescribe;
    }

    public void setOrderDescribe(String orderDescribe) {
        this.orderDescribe = orderDescribe == null ? null : orderDescribe.trim();
    }


    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", clientId=" + clientId +
                ", client=" + client +
                ", orderNumber='" + orderNumber + '\'' +
                ", paymentType=" + paymentType +
                ", orderDescribe='" + orderDescribe + '\'' +
                ", state=" + state +
                ", orderForms=" + orderForms +
                '}';
    }
}
